#include <engine.h>


GWindow::GWindow(QWidget *parent) 
	: QGraphicsView(parent)
{
	setScene(&m_scene);
    setRenderHint(QPainter::Antialiasing);
    setCacheMode(QGraphicsView::CacheBackground);
	setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
}

GWindow::~GWindow()
{
}

QGraphicsScene* GWindow::GetScene()
{
	return &m_scene;
}

void GWindow::AddObject(GObject* pObject)
{
    m_scene.addItem(pObject);
}

void GWindow::AddItem(QGraphicsItem* pItem, int x, int y)
{
	pItem->setPos(x,y);
    m_scene.addItem(pItem);
}
